/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.etecmatao.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author admin
 */
@Entity
@Table(name = "fotos_noticias")
@NamedQueries({
    @NamedQuery(name = "FotosNoticias.findAll", query = "SELECT f FROM FotosNoticias f"),
    @NamedQuery(name = "FotosNoticias.findByIdFotosNoticias", query = "SELECT f FROM FotosNoticias f WHERE f.idFotosNoticias = :idFotosNoticias"),
    @NamedQuery(name = "FotosNoticias.findByStatus", query = "SELECT f FROM FotosNoticias f WHERE f.status = :status")})
public class FotosNoticias implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_FotosNoticias")
    private Integer idFotosNoticias;
    @Basic(optional = false)
    @Lob
    @Column(name = "imagem")
    private byte[] imagem;
    @Basic(optional = false)
    @Column(name = "status")
    private String status;
    @JoinColumn(name = "Noticias_id_Noticias", referencedColumnName = "id_Noticias")
    @ManyToOne(optional = false)
    private Noticias noticias;

    public FotosNoticias() {
    }

    public FotosNoticias(Integer idFotosNoticias) {
        this.idFotosNoticias = idFotosNoticias;
    }

    public FotosNoticias(Integer idFotosNoticias, byte[] imagem, String status) {
        this.idFotosNoticias = idFotosNoticias;
        this.imagem = imagem;
        this.status = status;
    }

    public Integer getIdFotosNoticias() {
        return idFotosNoticias;
    }

    public void setIdFotosNoticias(Integer idFotosNoticias) {
        this.idFotosNoticias = idFotosNoticias;
    }

    public byte[] getImagem() {
        return imagem;
    }

    public void setImagem(byte[] imagem) {
        this.imagem = imagem;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Noticias getNoticias() {
        return noticias;
    }

    public void setNoticias(Noticias noticias) {
        this.noticias = noticias;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFotosNoticias != null ? idFotosNoticias.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FotosNoticias)) {
            return false;
        }
        FotosNoticias other = (FotosNoticias) object;
        if ((this.idFotosNoticias == null && other.idFotosNoticias != null) || (this.idFotosNoticias != null && !this.idFotosNoticias.equals(other.idFotosNoticias))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "admin.model.FotosNoticias[idFotosNoticias=" + idFotosNoticias + "]";
    }

}
